/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cs575.dbentities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 *
 * @author bms
 */
@Embeddable
public class TaskAssignPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "task_id", nullable = false)
    private int taskId;
    @Basic(optional = false)
    @Column(name = "source_user_id", nullable = false)
    private int sourceUserId;
    @Basic(optional = false)
    @Column(name = "dest_user_id", nullable = false)
    private int destUserId;

    public TaskAssignPK() {
    }

    public TaskAssignPK(int taskId, int sourceUserId, int destUserId) {
        this.taskId = taskId;
        this.sourceUserId = sourceUserId;
        this.destUserId = destUserId;
    }

   
    public int getTaskId() {
        return taskId;
    }

    public void setTaskId(int taskId) {
        this.taskId = taskId;
    }

    public int getSourceUserId() {
        return sourceUserId;
    }

    public void setSourceUserId(int sourceUserId) {
        this.sourceUserId = sourceUserId;
    }

    public int getDestUserId() {
        return destUserId;
    }

    public void setDestUserId(int destUserId) {
        this.destUserId = destUserId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) taskId;
        hash += (int) sourceUserId;
        hash += (int) destUserId;
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TaskAssignPK)) {
            return false;
        }
        TaskAssignPK other = (TaskAssignPK) object;
        if (this.taskId != other.taskId) {
            return false;
        }
        if (this.destUserId != other.destUserId) {
            return false;
        }
        if (this.sourceUserId != other.sourceUserId ) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "cs575.dbentities.TaskAssignPK[ taskId=" + taskId + ", sourceUserId=" + sourceUserId + ", destUserId=" + destUserId + " ]";
    }
    
}
